package com.heima.comment.controller;

import com.heima.comment.service.CommentRepayService;
import com.heima.comment.service.CommentService;
import com.heima.model.comment.dtos.*;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author XHui
 * @Since 2024/3/4 16:06
 * @Version 1.0
 */
@Api(value = "app端用户管理api", tags = "app端用户管理api")
@RestController
@RequestMapping("/api/v1/comment_repay")
public class ApCommentRepayController {

    @Resource
    private CommentRepayService commentRepayService;

    @PostMapping("/save")
    public ResponseResult saveCommentRepay(
            @RequestBody @Validated CommentRepaySaveDTO dto)  {
             return commentRepayService.saveCommentRepay(dto);
    }

    @PostMapping("/like")
    public ResponseResult likeOperation(
            @RequestBody @Validated CommentRepayLikeDTO dto) {
        return commentRepayService.saveCommentRepayLike(dto);
    }

    @PostMapping("/load")
    public ResponseResult loadComment(
            @RequestBody @Validated CommentRepayDTO dto)  {
        return commentRepayService.loadCommentRepay(dto);
    }
}
